package com.fansl.allround.upms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fansl.allround.upms.api.entity.SysUserRole;
import com.fansl.allround.upms.mapper.SysUserRoleMapper;
import com.fansl.allround.upms.service.SysUserRoleService;
import org.springframework.stereotype.Service;

/**
 * @author fansl
 * @Description: 用户角色表 服务实现类
 * @date 2019/8/13 12:01
 */
@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements SysUserRoleService {
    /**
     * 根据用户Id删除该用户的角色关系
     *
     * @param userId
     * @return boolean
     */
    @Override
    public Boolean removeRoleByUserId(Integer userId) {
        return baseMapper.deleteByUserId(userId);
    }

    /**
     * 没有则新增，有则忽略
     *
     * @param sysUserRole
     * @return
     */
    @Override
    public int ignoreSave(SysUserRole sysUserRole) {
        return baseMapper.ignoreSave(sysUserRole);
    }
}
